{*
 * @author 		Zprofess <contact@zprofess.com>
 * @copyright  	2011 Zprofess
 * @version  	1.0 
 * @license    http://opensource.org/licenses/afl-3.0.php  Academic Free License (AFL 3.0)
 *}

{if $latestReviews|@count gt 0}
	<div id="latest-reviews_block_left" class="block products_block">
		<h4>{l s='Latest Reviews' mod='reviewratingsynthesis'}</h4>
		<div class="block_content">
			<ul class="products clearfix">
				{foreach from=$latestReviews item=latestReview name=myLoop}
					<li class="clearfix{if $smarty.foreach.myLoop.last} last_item{elseif $smarty.foreach.myLoop.first} first_item{else} item{/if}">
						<a href="{$link->getProductLink($latestReview['id_product'], $latestReview['link_rewrite'], $latestReview['category_rewrite'])}" title="{l s='More about' mod='reviewratingsynthesis'} {$latestReview['name']|escape:html:'UTF-8'}"><img src="{$link->getImageLink($latestReview['link_rewrite'], $latestReview['cover'], 'medium')}" height="{$mediumSize.height}" width="{$mediumSize.width}" alt="{$latestReview['legend']|escape:html:'UTF-8'}" /></a>
						<h5><a href="{$link->getProductLink($latestReview['id_product'], $latestReview['link_rewrite'], $latestReview['category_rewrite'])}" title="{l s='More about' mod='reviewratingsynthesis'} {$latestReview['name']|escape:html:'UTF-8'}">{$latestReview['name']|truncate:14:'...'|escape:html:'UTF-8'}</a></h5>
	
						{if !{$only_review}}
						<div class="average_latest">
							<div id="hook_raty_{$smarty.foreach.myLoop.iteration}" class="displayAverageLatest_{$smarty.foreach.myLoop.iteration}"></div>
							<script type="text/javascript">
								$(".displayAverageLatest_{$smarty.foreach.myLoop.iteration}").raty({									
									width: 			{$configRating['width']},
									cancel: 		{$configRating['cancel']},						
									cancelHint:   	"{$configRating['cancelHint']}",  
									cancelOff:  	"{$configRating['cancelOff']}",
									cancelOn:   	"{$configRating['cancelOn']}", 	
									cancelPlace:  	"{$configRating['cancelPlace']}", 
								
									half:  			true,
									space:       	false,
									hintList:		{$configRating['hintList']},
									noRatedMsg:		"{$configRating['noRatedMsg']}",
									number:     	{$configRating['number']},
									path:           "{$configRating['path']}",	
									starHalf:		"{$configRating['starHalf']}",
									starOff:		"{$configRating['starOff']}",
									starOn:			"{$configRating['starOn']}",
									readOnly:		true,
									start: 			{$latestReview['rating']},
								});
							</script>
						</div>
						{/if}
	
						<p>{$latestReview['content']|strip_tags:'UTF-8'|truncate:44}<a href="{$link->getProductLink($latestReview['id_product'], $latestReview['link_rewrite'], $latestReview['category_rewrite'])}" title="{l s='More about' mod='reviewratingsynthesis'} {$latestReview['name']|escape:html:'UTF-8'}"><img src="{$img_dir}bullet.gif" alt="&gt;&gt;" width="10" height="7" /></a></p>
						<div class="clear"></div>
						<div class="customer_name">{$latestReview['customer_name']|escape:'html':'UTF-8'}</div>
					</li>
				{/foreach}
			</ul>
		</div>
	</div>
{/if}

{if $latestVote|@count gt 0}
	<div id="latest-reviews_block_left" class="block products_block">
		<h4>{l s='Like Most' mod='reviewratingsynthesis'}</h4>
		<div class="block_content">
			<ul class="products clearfix">
				{foreach from=$latestVote item=vote name=myLoop}
					<li class="clearfix{if $smarty.foreach.myLoop.last} last_item{elseif $smarty.foreach.myLoop.first} first_item{else} item{/if}">
						<a href="{$link->getProductLink($vote['id_product'], $vote['link_rewrite'], $vote['category_rewrite'])}" title="{l s='More about' mod='reviewratingsynthesis'} {$vote['name']|escape:html:'UTF-8'}"><img src="{$link->getImageLink($vote['link_rewrite'], $vote['cover'], 'medium')}" height="{$mediumSize.height}" width="{$mediumSize.width}" alt="{$vote['legend']|escape:html:'UTF-8'}" /></a>
						<h5><a href="{$link->getProductLink($vote['id_product'], $vote['link_rewrite'], $vote['category_rewrite'])}" title="{l s='More about' mod='reviewratingsynthesis'} {$vote['name']|escape:html:'UTF-8'}">{$vote['name']|truncate:14:'...'|escape:html:'UTF-8'}</a></h5>
	
						{if !{$only_review}}
						<div class="average_latest">
							<div class="displayAverageMost_{$smarty.foreach.myLoop.iteration}"></div>
							<script type="text/javascript">
								$(".displayAverageMost_{$smarty.foreach.myLoop.iteration}").raty({									
									width: 			{$configRating['width']},
									cancel: 		{$configRating['cancel']},						
									cancelHint:   	"{$configRating['cancelHint']}",  
									cancelOff:  	"{$configRating['cancelOff']}",
									cancelOn:   	"{$configRating['cancelOn']}", 	
									cancelPlace:  	"{$configRating['cancelPlace']}", 
								
									half:  			true,
									space:       	false,
									hintList:		{$configRating['hintList']},
									noRatedMsg:		"{$configRating['noRatedMsg']}",
									number:     	{$configRating['number']},
									path:           "{$configRating['path']}",	
									starHalf:		"{$configRating['starHalf']}",
									starOff:		"{$configRating['starOff']}",
									starOn:			"{$configRating['starOn']}",
									readOnly:		true,
									start: 			{$vote['rating']},
								});
							</script>
						</div>
						{/if}
	
						<p>{$vote['content']|strip_tags:'UTF-8'|truncate:44}<a href="{$link->getProductLink($vote['id_product'], $vote['link_rewrite'], $vote['category_rewrite'])}" title="{l s='More about' mod='reviewratingsynthesis'} {$vote['name']|escape:html:'UTF-8'}"><img src="{$img_dir}bullet.gif" alt="&gt;&gt;" width="10" height="7" /></a></p>
						<div class="clear"></div>
						<div class="customer_name">{$vote['customer_name']|escape:'html':'UTF-8'}</div>
					</li>
				{/foreach}
			</ul>
		</div>
	</div>
{/if}